<!--
 * @Author: your name
 * @Date: 2021-01-04 15:57:19
 * @LastEditTime: 2021-01-04 17:15:38
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \H5 2010 studyd:\H5 2010 练习\考试\第三阶段 Vue\proj_muke\src\components\tab-bar\index.vue
-->
<template>
  <div id="TabBar">
    <van-tabbar v-model="active" route>
      <van-tabbar-item
        v-for="route in tabNavs"
        :key="route.path"
        :icon="route.meta.icon"
        :to="route.path"
      >
        {{ route.meta.title }}
      </van-tabbar-item>
    </van-tabbar>
  </div>
</template>

<script>
import routes from '@/router/routes'

export default {
  name: 'TabBar',
  data() {
    return {
      active: 1
    }
  },
  computed: {
    tabNavs() {
      return routes.filter(item => item.meta && item.meta.isTab)
    }
  }
}
</script>

<style lang="scss" scoped></style>
